<template>
  <view class="container tn-safe-area-inset-bottom">
    <!-- 顶部自定义导航 -->
    <tn-nav-bar fixed alpha="false">我的点赞</tn-nav-bar>

    <view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
      <!-- 顶部标签 -->
      <view class="tn-bg-white">
        <tn-tabs-swiper class="sss" :list="categoryList" :current="current" :isScroll="false" activeColor="#000" :bold="true" @change="changeTab"  backgroundColor="#FFFFFF99" :height="100"></tn-tabs-swiper>
      </view>
    </view>

    <!-- 图文 -->
    <view class="tn-flex tn-flex-direction-column">
      <!-- 案例内容列表 -->
      <tn-list-view v-if="0 == current">
        <cx-user-project-list :model="model"></cx-user-project-list>
      </tn-list-view>

      <!-- 方案内容列表 -->
      <tn-list-view v-if="1 == current">
        <cx-user-demand-list :model="model"></cx-user-demand-list>
      </tn-list-view>

      <!-- 文章内容列表 -->
      <tn-list-view v-if="2 == current">
        <cx-user-article-list :model="model"></cx-user-article-list>
      </tn-list-view>
    </view>
  </view>
</template>

<script>
  import base from '@/common/mixin/base.js';
	import request from '@/common/request.js';
  import CxUserProjectList from "@/component/cx-user-project-list/index.vue";
  import CxUserDemandList from "@/component/cx-user-demand-list/index.vue";
  import CxUserArticleList from "@/component/cx-user-article-list/index.vue";

  export default {
    name: 'Collection',
    mixins: [base],
    components:{
    	CxUserProjectList,
      CxUserDemandList,
      CxUserArticleList,
    },
    data() {
      return {
        model: 'member/project/approval',
        modelList: [
          'member/project/approval',
          'member/demand/approval',
          'member/article/approval',
        ],
        categoryList: [
          {id: 1, name: '案例'},
          {id: 2, name: '方案'},
          {id: 3, name: '文章'},
        ],
      }
    },
    methods: {
      changeTab: function(index) {
        this.current = index;
        this.model = this.modelList[index];
      }
    },
  }
</script>

<style lang="scss" scoped>
  @import '@/static/scss/common.scss';
</style>
